<%@ page language="java" import="java.util.*"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.rapid-framework.org.cn/rapid" prefix="rapid"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<rapid:override name="frame-content">
    <blockquote class="layui-elem-quote">
					<span class="layui-breadcrumb" lay-separator="/"> <a
						href="/admin">首页</a> <a><cite>文章列表</cite></a>
					</span>
				</blockquote>

				<div class="layui-tab layui-tab-card">
					<form id="articleForm" method="post">
						<input type="hidden" name="currentUrl" id="currentUrl" value="">
						<table class="layui-table">
							<colgroup>
								<col width="300">
								<col width="150">
								<col width="100">
								<col width="150">
								<col width="100">
								<col width="50">
							</colgroup>
							<thead>
								<tr>
									<th>标题</th>
									<th>所属分类</th>
									<th>状态</th>
									<th>发布时间</th>
									<th>操作</th>
									<th>id</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${pageInfo.list }" var="article">
							  <tr>
									<td><a href="/article/${article.articleId }" target="_blank"> ${article.articleTitle }</a></td>
									<td>
										<c:forEach items="${article.categorys }" var="category">
										  <a href="/category/${category.categoryId }" target="_blank">${category.categoryName }</a>&nbsp;&nbsp;
										  &nbsp;&nbsp;&nbsp;
										</c:forEach>
									</td>
										
									<td>
									   <a href="/admin/article?status=${article.articleStatus}">
									       <c:if test="${article.articleStatus == 1}">
									          <span style="color: #5FB878;">已发布</span>
									      </c:if>
									      <c:if test="${article.articleStatus == 0}">
									          <span style="color: red;">草稿</span>
									      </c:if>
									   </a>
									</td>
									<td>
									  <fmt:formatDate value="${article.articleCreateTime }" pattern="yyyy-MM-dd hh:mm:ss"/>
									</td>
									<td><a href="/admin/article/edit/${article.articleId }"
										class="layui-btn layui-btn-mini">编辑</a> <a
										href="javascript:void(0)" onclick="deleteArticle(${article.articleId })"
										class="layui-btn layui-btn-danger layui-btn-mini">删除</a></td>
									<td>${article.articleId }</td>
								</tr>
								</c:forEach>
								
								
							</tbody>
						</table>
					</form>
					<%@ include file="../page.jsp" %>
				</div>
</rapid:override>
<%@ include file="../framework.jsp"%>